home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Amos
/
AMOSList-1297
/
AMOSLIST
/
000014_amos-request@svcs1.digex.net_Tue Dec 2 19:26:59 1997.msg
< prev
next >
Wrap
Text File
|
1998-06-24
|
3KB
|
79 lines
Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
by mail4.access.digex.net (8.8.5/8.8.5) with ESMTP id TAA27317
for <mcox@access.digex.net>; Tue, 2 Dec 1997 19:26:48 -0500 (EST)
Received: (from daemon@localhost)
by svcs1.digex.net (8.8.5/8.8.5) id QAA22172
for amos-out; Tue, 2 Dec 1997 16:20:30 -0500 (EST)
Received: from mail4.access.digex.net (mail4.access.digex.net [205.197.247.2])
by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id QAA22169
for <amos-list@svcs1.digex.net>; Tue, 2 Dec 1997 16:20:29 -0500 (EST)
Received: from mailhost.sosbbs.com (sosbbs.com [204.186.168.100])
by mail4.access.digex.net (8.8.5/8.8.5) with SMTP id QAA03129
for <amos-list@access.digex.net>; Tue, 2 Dec 1997 16:20:16 -0500 (EST)
Received: from gbenjam (204.186.168.71) by mailhost.sosbbs.com
(EMWAC SMTPRS 0.81) with SMTP id <B0000150245@mailhost.sosbbs.com>;
Tue, 02 Dec 1997 16:19:18 -0500
Message-ID: <B0000150245@mailhost.sosbbs.com>
From: "Garfield Benjamin" <gbenjam@sosbbs.com>
To: "AMOS MAILING LIST" <amos-list@access.digex.net>
Subject: Re: Fast collisions - THE REAL CODE!!!!
Date: Tue, 2 Dec 1997 16:25:29 -0500
X-MSMail-Priority: Normal
X-Priority: 3
X-Mailer: Microsoft Internet Mail 4.70.1155
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Status: O
X-Status:
Amazing isn't? How you can write something and then later take a
look at it and the foolishness is no very obvious...
In my previous reply to the collision-detection I made a rather
stupid design, resulting in the collision-detection being MUCH
slower than it should be, not quite sure what happened there,
sorry. :)
Anyway, the new design is:
For OBJECT1=0 To 10
If Bob Col(OBJECT1, OBJECT1+1 To 11)
For OBJECT2=OBJECT1+1 To 11
If Col(OBJECT2)
Rem Objects OBJECT1 and OBJECT2 have collided, so
Rem do your collision-processing here...
End If
Next OBJECT2
End If
Next OBJECT1
Now, THAT IS AN OPTIMIZED DESIGN!!!!
The advantages over the first one:
1. The MAIN advantage is that each collision between any two
objects is only performed once so we only need a total of 66
Col checks, AND these Col checks are only performed if
AMOS has detected a collison, so it should be VERY FAST.
2. The actual loop-processing is very tiny which means it will be
quite fast.
3. We're no longer utilizing an external Procedure call, which also
makes this version a bit faster.
Finally, the whole thing is highly stream-lined and is the essence of
creating an optimized design!!
If this doesn't speed up your game then the problem MUST be
something other than the collision-detection...
Let me know what the new frame-rate is!!
Take care,
GARFIELD
_________________________
Current projects...
SideShooter(AMOS): 85% Complete
Website(http://www.sosbbs.com/~gbenjam): 20% Complete